// 定义变量
// 变量声明：类型 = 值
const num: number = 1;

const bool: boolean = true;

const str1: string = "1231";
const str2: string = "1231";
const str3: string = `1231`;

const arr: number[] = [1, 2, 3, 4, 5];
const arr1: boolean[] = [true, false];
const arr2: string[] = ["1231321"];

// 元组 Tuple
const t1: [number, boolean] = [1, true];

// 枚举
enum Color {
  Red,
  Yello,
  Green,
}

// Color.Red  => 0
// Color[0]   => Red

// Any: 任意类型
// 类型检查器对这些值进行检查而是直接让它们通过编译阶段的检查。
let a: any = 123;

a = 445;
a = 0;

a = "123";
a = true;
a = [1, 0.2, 34];

// Void: 函数没有返回值
function fn() {}

// Null 和 Undefined

let n: null = null;
let u: undefined = undefined;

// Never: never类型表示的是那些永不存在的值的类型

function fnn(): never {
  // while(true) {

  // }

  throw new Error("错了！！！");
}

const s: never = fnn();

// Object
// const o1: object = {};
// const o2: object = function () {};
// const o3: object = [];
// const o5: object = new String("1231231");
// const o4: object = new Number(123);
// const o6: object = new Date()
// const o7: object = Math

